<?php
/**
 * 
 *
 * @author Iain Edminster
 */
class Bliss_DataReport_Form extends Zend_Form
{
	/**
	 * Holds the Bliss_DataReport object
	 * 
	 * @var Bliss_DataReport
	 */
	protected $_report;

	/**
	 * Class constructor
	 *
	 * @param Bliss_DataReport $report
	 * @param array $attribs
	 */
	public function __construct(Bliss_DataReport $report, array $attribs=null)
	{
		$this->_report	= $report;

		parent::__construct();
		
		$this->setAttribs(array(
			'method' => 'get',
			'class' => 'report-form'
		));
		if(isset($attribs)) {
			$this->setAttribs($attribs);
		}
	}

	public function addReportForm($name, $legend=null)
	{
		$class	= "Bliss_DataReport_Form_{$name}";
		$sub = new $class($this->_report);
		$sub->setLegend($legend);
		$this->addSubForm($sub, $name);
	}
}
?>
